package org.example.test1.newcontroller;

import org.example.test1.newservice.UpdateService;
import org.example.test1.pojo.Result;
import org.example.test1.pojo.dto.UpdateDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/brand")
public class UpdateController {
    @Autowired
    private UpdateService updateService;

    // 改改改
    @PutMapping("/{id}")
    public Result update(@PathVariable int id, @RequestBody UpdateDto updateDto){
        updateDto.setId(id);
        updateService.update(updateDto);
        return Result.success();
    }


}
